
require 'watir'
include Watir
require 'test/unit'
require '../watir.config.rb'
require '../resources/functions.rb'
require 'win32ole'
require 'win32/process'


class TC_ContentThemes_test < Test::Unit::TestCase
   
    def startup
      $SitePath = '../resources/Images/gallery_slideshow.gif'
      $FilePath1 = '../resources/Images/gallery_slideshow.gif'
      $FilePath = '../resources/Images/hawaii-ThemeConfiguration.xml'
      @@ie = Watir::IE.start($SITE_URL)
      
    end
    
    def ie
      if defined? @@ie
        @@ie
      else
        startup
      end  
    end
    
    def test_0000
        require 'win32/process'
        $pid = Process.create(
        :app_name      => 'ruby ../resources/clickers.rb',
        :creation_flags  => Process::DETACHED_PROCESS
        ).process_id

    end  

    
    def test_01_verifyHomeText
        assert(ie.contains_text(/Community Server/))		
      end

    def test_02_verifyLoginLinksExist
      if !(ie.link(:text, 'Sign in').exists?)
        ie.goto($SITE_URL + 'logout.aspx')
        ie.refresh
        ie.goto($SITE_URL)
        ie.refresh
      end
	  end

    def test_03_navigateToLogin
        ie.link(:text, 'Sign in').click
        assert(ie.contains_text("Sign in name"))
      end

	  def test_04_populateLoginForm
        ie.text_field(:id, /username$/).value = $ADMIN_USER
        assert(ie.text_field(:id, /username$/).verify_contains($ADMIN_USER))
        ie.text_field(:id, /password$/).value = $ADMIN_PASSWORD
        assert(ie.text_field(:id, /password$/).verify_contains($ADMIN_PASSWORD))
      end

   def test_05_submitLoginForm
        if(ie.button(:id, /loginButton$/).exists?)
          ie.button(:id, /loginButton$/).click
        else
        ie.link(:id, /loginButton$/).click
        end
        test_01_verifyHomeText
      end
    
    def test_06_verifyControlPanel
        assert(ie.link(:text, /Control Panel/).exists?)
        ie.link(:text, /Control Panel/).click
        assert(ie.contains_text(/Announcements/))
        assert(ie.link(:text, /System Administration/).exists?)
        ie.link(:text, /System Administration/).click
        assert(ie.contains_text(/Announcements/))
      end

    def test_07_verifyControlPanelLinks
        assert_equal $SITE_URL + 'controlpanel/', ie.link(:text, 'Dashboard').href
        assert_equal $SITE_URL + 'controlpanel/setup.aspx', ie.link(:text, 'Administration').href
        assert_equal $SITE_URL + 'controlpanel/BlogAdmin/', ie.link(:text, 'Blog Administration').href
        assert_equal $SITE_URL + 'controlpanel/MediaGalleryAdmin/', ie.link(:text, 'Media Galleries Administration').href
        assert_equal $SITE_URL + 'controlpanel/Forums/', ie.link(:text, 'Forum Administration').href
        assert_equal $SITE_URL + 'controlpanel/HubAdmin/', ie.link(:text, 'Group Administration').href
        assert_equal $SITE_URL + 'controlpanel/Membership/membersearch.aspx?SelectedNavItem=BrowseMembers', ie.link(:text, 'Membership Administration').href
        assert_equal $SITE_URL + 'controlpanel/Settings/default.aspx', ie.link(:text, 'Site Administration').href
      end

    def test_08_navigateToSiteAdministration
        ie.goto($SITE_URL + 'controlpanel/Settings/default.aspx')
        assert(ie.contains_text('Site Administration'))      
      end

    def test_09_verifyLinksExist
        # Make sure that all of the links exist
        assert(ie.link(:text, 'Log Out').exists?)
        assert(ie.link(:text, 'Help').exists?)
        assert(ie.link(:text, 'Go to Site').exists?)
        assert(ie.link(:text, 'Dashboard').exists?)
        assert(ie.link(:text, 'Administration').exists?)
        assert(ie.link(:text, 'Telligent').exists?)
      end
      
    def test_10_navigateToContentThemesPage
        ie.goto($SITE_URL + 'controlpanel/Settings/ThemeConfiguration.aspx')
        assert(ie.select_list(:id,/Themes_state$/).exists?)
        ie.select_list(:id,/Themes_state$/).select('Hawaii')
        sleep 2
        assert(ie.checkbox(:id,/ConfigurationForm_ctl10_ctl03$/).exists?)
        ie.checkbox(:id,/ConfigurationForm_ctl10_ctl03$/).set
        assert(ie.text_field(:id,/ConfigurationForm_ctl11_ctl03_ctl00_Editor$/).exists?)
      end

    def test_11_LayoutGeneral
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.SelectTab(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.GetTabAtIndex(1))")
        # Layout
        assert(ie.text_field(:id,/ConfigurationForm_ctl18_ctl03_text$/).exists?)
        ie.text_field(:id,/ConfigurationForm_ctl18_ctl03_text$/).set('960')
        
        # General Content
        assert(ie.text_field(:id,/ConfigurationForm_ctl21_ctl03_text$/).exists?)
        ie.text_field(:id,/ConfigurationForm_ctl21_ctl03_text$/).value = '#927575'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.select_list(:id,/ConfigurationForm_ctl22_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl22_ctl03_state$/).select('Georgia')
        # Links
        assert(ie.text_field(:id,/ConfigurationForm_ctl25_ctl03_text$/).exists?)
        ie.text_field(:id,/ConfigurationForm_ctl25_ctl03_text$/).value = '#8d8080'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id,/ConfigurationForm_ctl26_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl26_ctl03_text$/).value ='#8d8080'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl27_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl27_ctl03_text$/).value ='#8d8080'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        
        # Background
        assert(ie.text_field(:id, /ConfigurationForm_ctl30_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl30_ctl03_text$/).value ='#8d8080'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.button(:id,/ConfigurationForm_ctl31_Button$/).exists?)
        ie.button(:id,/ConfigurationForm_ctl31_Button$/).click
        sleep 5
        assert(ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_width').exists?)
        ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_width').value ='200'
        assert(ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_height').exists?)
        ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_height').value ='200'
        assert(ie.frame(:index,2).fileField(:name,'ctl00$bcr$ctl00$ctl00$ctl08').exists?)
        ie.frame(:index,2).fileField(:name,'ctl00$bcr$ctl00$ctl00$ctl08').set($SetPath)
        assert(ie.frame(:index,2).button(:value,'Upload File').exists?)
        ie.frame(:index,2).button(:value,'Upload File').click
        assert(ie.frame(:index,2).link(:id,/SelectButton$/).exists?)
        ie.frame(:index,2).link(:id,/SelectButton$/).click
      end
      
    def test_12_Header
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.SelectTab(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.GetTabAtIndex(2))")
        # Site Title
        assert(ie.text_field(:id, /ConfigurationForm_ctl39_ctl03_text$/).exists?)
        ie.text_field(:id,/ConfigurationForm_ctl39_ctl03_text/).value ='114px'
        assert(ie.text_field(:id, /ConfigurationForm_ctl40_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl40_ctl03_text$/).value ='#60767f'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl41_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl41_ctl03_text$/).value = '#ffffff'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl42_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl42_ctl03_text$/).value='#c04444'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.button(:id ,/ConfigurationForm_ctl43_Button$/).exists?)
        ie.button(:id,/ConfigurationForm_ctl43_Button$/).click
        sleep 5
        assert(ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_width').exists?)
        ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_width').value ='150'
        assert(ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_height').exists?)
        ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_height').value ='150'
        assert(ie.frame(:index,2).fileField(:name,'ctl00$bcr$ctl00$ctl00$ctl08').exists?)
        ie.frame(:index,2).fileField(:name,'ctl00$bcr$ctl00$ctl00$ctl08').set($SetPath)
        assert(ie.frame(:index,2).button(:value,'Upload File').exists?)
        ie.frame(:index,2).button(:value,'Upload File').click
        assert(ie.frame(:index,2).link(:text , 'OK').exists?)
        ie.frame(:index,2).link(:text , 'OK').click
        assert(ie.button(:id ,/ConfigurationForm_ctl44_Button$/).exists?)
        ie.button(:id,/ConfigurationForm_ctl44_Button$/).click
        sleep 5
        assert(ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_width').exists?)
        ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_width').value ='150'
        assert(ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_height').exists?)
        ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_height').value ='150'
        assert(ie.frame(:index,2).fileField(:name,'ctl00$bcr$ctl00$ctl00$ctl08').exists?)
        ie.frame(:index,2).fileField(:name,'ctl00$bcr$ctl00$ctl00$ctl08').set($SetPath)
        assert(ie.frame(:index,2).button(:name,'ctl00$bcr$ctl00$ctl00$ctl09').exists?)
        ie.frame(:index,2).button(:name,'ctl00$bcr$ctl00$ctl00$ctl09').click
        assert(ie.frame(:index,2).link(:text , 'OK').exists?)
        ie.frame(:index,2).link(:text , 'OK').click
        assert(ie.select_list(:id,/ConfigurationForm_ctl45_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl45_ctl03_state$/).select('Courier New')
        assert(ie.select_list(:id,/ConfigurationForm_ctl46_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl46_ctl03_state$/).select('Medium')
        
        
        # Navigation Bar
        assert(ie.text_field(:id, /ConfigurationForm_ctl49_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl49_ctl03_text$/).value = '#e9eef9'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl50_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl50_ctl03_text$/).value = '#000000'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl51_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl51_ctl03_text$/).value = '#ffffff'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl52_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl52_ctl03_text$/).value = '#ffffff'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        # Breadcrumbs
        assert(ie.text_field(:id, /ConfigurationForm_ctl55_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl55_ctl03_text$/).value = '#e9eef9'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl56_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl56_ctl03_text$/).value = '#000000'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
      end
      
    def test_13_Body
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.SelectTab(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.GetTabAtIndex(3))")
        
        # Page Title
        assert(ie.text_field(:id, /ConfigurationForm_ctl64_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl64_ctl03_text$/).value='#8b4545'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.select_list(:id,/ConfigurationForm_ctl65_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl65_ctl03_state$/).select('Tahoma')
        assert(ie.select_list(:id,/ConfigurationForm_ctl66_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl66_ctl03_state$/).select('Larger')
        
        #Common Content Boxes
         assert(ie.text_field(:id, /ConfigurationForm_ctl69_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl69_ctl03_text$/).value='#9a6730'
        assert(ie.text_field(:id, /ConfigurationForm_ctl70_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl70_ctl03_text$/).value='#9a6730'
        assert(ie.text_field(:id, /ConfigurationForm_ctl71_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl71_ctl03_text$/).value='#8b4545'
        assert(ie.select_list(:id,/ConfigurationForm_ctl72_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl72_ctl03_state$/).select('Impact')
        
        # Announcement Content Boxes
        assert(ie.text_field(:id, /ConfigurationForm_ctl75_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl75_ctl03_text$/).value='#8b4545'
        assert(ie.text_field(:id, /ConfigurationForm_ctl76_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl76_ctl03_text$/).value='#8b4545'
        assert(ie.text_field(:id, /ConfigurationForm_ctl77_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl77_ctl03_text$/).value='#8b4545'
        assert(ie.select_list(:id,/ConfigurationForm_ctl78_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl78_ctl03_state$/).select('Georgia')
        
        # Activity Content Boxes
        assert(ie.text_field(:id, /ConfigurationForm_ctl81_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl81_ctl03_text$/).value='#9a6730'
        assert(ie.text_field(:id, /ConfigurationForm_ctl82_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl82_ctl03_text$/).value='#9a6730'
        assert(ie.text_field(:id, /ConfigurationForm_ctl83_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl83_ctl03_text$/).value='#8b4545'
        assert(ie.select_list(:id,/ConfigurationForm_ctl84_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl84_ctl03_state$/).select('Terminal')
        
        # Highlighted Content Boxes
        assert(ie.text_field(:id, /ConfigurationForm_ctl87_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl87_ctl03_text$/).value='#9a6730'
        assert(ie.text_field(:id, /ConfigurationForm_ctl88_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl88_ctl03_text$/).value='#9a6730'
        assert(ie.text_field(:id, /ConfigurationForm_ctl89_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl89_ctl03_text$/).value='#8b4545'
        assert(ie.select_list(:id,/ConfigurationForm_ctl90_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl90_ctl03_state$/).select('Terminal')
        
        #Message Bubbles
        assert(ie.text_field(:id, /ConfigurationForm_ctl93_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl93_ctl03_text$/).value='#434b5c'
        assert(ie.text_field(:id, /ConfigurationForm_ctl94_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl94_ctl03_text$/).value='#e51681'
        
        # File Boxes
        assert(ie.text_field(:id, /ConfigurationForm_ctl97_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl97_ctl03_text$/).value='#452525'
          
        # List Content
        assert(ie.text_field(:id, /ConfigurationForm_ctl100_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl100_ctl03_text$/).value =' ##a91b1b'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.select_list(:id,/ConfigurationForm_ctl101_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl101_ctl03_state$/).select('Comic Sans MS')
        assert(ie.select_list(:id,/ConfigurationForm_ctl102_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl102_ctl03_state$/).select('Larger')
        assert(ie.text_field(:id, /ConfigurationForm_ctl103_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl103_ctl03_text$/).value =' #7c4848'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl104_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl104_ctl03_text$/).value ='#322121'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl105_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl105_ctl03_text$/).value ='#7a6969'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        
        
        # Forum Post
        assert(ie.text_field(:id, /ConfigurationForm_ctl108_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl108_ctl03_text$/).value ='#142313'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.select_list(:id,/ConfigurationForm_ctl109_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl109_ctl03_state$/).select('Courier New')
        assert(ie.select_list(:id,/ConfigurationForm_ctl110_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl110_ctl03_state$/).select('Smaller')
        assert(ie.text_field(:id, /ConfigurationForm_ctl111_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl111_ctl03_text$/).value ='#5264ee'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl112_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl112_ctl03_text$/).value ='#f0dcd5'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl113_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl113_ctl03_text$/).value ='#fc0e19'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl114_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl114_ctl03_text$/).value ='#77090b'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.text_field(:id, /ConfigurationForm_ctl115_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl115_ctl03_text$/).value ='#3f3f3f'
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
      end

    def test_14_Sidebar
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.SelectTab(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.GetTabAtIndex(4))")
        
        # Sidebar 
        #~ assert(ie.div(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl100').exists?)
        #~ ie.div(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl100').fire_event "onClick"
        
        assert(ie.text_field(:id, /ConfigurationForm_ctl123_ctl03_text$/).exists?)
        ie.text_field(:id,/ConfigurationForm_ctl123_ctl03_text$/).value ='250'
 
        # Blog Sidebar
        
        assert(ie.select_list(:id,/ConfigurationForm_ctl126_cfoptions_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl126_cfoptions_state$/).select('Blog Archive List')
        assert(ie.button(:id ,/ConfigurationForm_ctl126_addButton$/).exists?)
        ie.button(:id ,/ConfigurationForm_ctl126_addButton$/).click
        sleep 2
        assert(ie.select_list(:id,/ConfigurationForm_ctl126_cfoptions_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl126_cfoptions_state$/).select('Google Gadget')
        assert(ie.button(:id ,/ConfigurationForm_ctl126_addButton$/).exists?)
        ie.button(:id ,/ConfigurationForm_ctl126_addButton$/).click
        sleep 2
        assert(ie.select_list(:id,/ConfigurationForm_ctl126_cfoptions_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl126_cfoptions_state$/).select('User List')
        assert(ie.button(:id ,/ConfigurationForm_ctl126_addButton$/).exists?)
        ie.button(:id ,/ConfigurationForm_ctl126_addButton$/).click
        sleep 5
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.GetItemCount()-1,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.GetItemCount()-2,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.GetItemCount()-3,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.GetItemCount()-4,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.GetItemCount()-3,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_down').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_down').fire_event "onclick"
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.GetItemCount()-2,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_down').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_down').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist.GetItemCount()-1,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_down').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_down').fire_event "onclick"
        sleep 2
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_delete').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl126_cflist_delete').fire_event "onclick"
        
        # Media Sidebar
        
        assert(ie.select_list(:id,/ConfigurationForm_ctl129_cfoptions_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl129_cfoptions_state$/).select('Navigation Links')
        assert(ie.button(:id ,/ConfigurationForm_ctl129_addButton$/).exists?)
        ie.button(:id ,/ConfigurationForm_ctl129_addButton$/).click
        sleep 2
        assert(ie.select_list(:id,/ConfigurationForm_ctl129_cfoptions_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl129_cfoptions_state$/).select('Google Gadget')
        assert(ie.button(:id ,/ConfigurationForm_ctl129_addButton$/).exists?)
        ie.button(:id ,/ConfigurationForm_ctl129_addButton$/).click
        sleep 2
        assert(ie.select_list(:id,/ConfigurationForm_ctl129_cfoptions_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl129_cfoptions_state$/).select('Widgetbox Widget')
        assert(ie.button(:id ,/ConfigurationForm_ctl129_addButton$/).exists?)
        ie.button(:id ,/ConfigurationForm_ctl129_addButton$/).click
        sleep 5
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.GetItemCount()-1,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.GetItemCount()-2,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.GetItemCount()-3,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.GetItemCount()-4,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.GetItemCount()-3,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_down').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_down').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.GetItemCount()-2,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_down').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_down').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist.GetItemCount()-1,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_down').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_down').fire_event "onclick"
        sleep 2
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_delete').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_delete').fire_event "onclick"
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl129_cflist_delete').fire_event "onclick"
        
        
        # Forum Siderbars
        
        assert(ie.select_list(:id,/ConfigurationForm_ctl132_cfoptions_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl132_cfoptions_state$/).select('Forums Thread List')
        assert(ie.button(:id ,/ConfigurationForm_ctl132_addButton$/).exists?)
        ie.button(:id ,/ConfigurationForm_ctl132_addButton$/).click
        sleep 2
        assert(ie.select_list(:id,/ConfigurationForm_ctl132_cfoptions_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl132_cfoptions_state$/).select('Forum Post')
        assert(ie.button(:id ,/ConfigurationForm_ctl132_addButton$/).exists?)
        ie.button(:id ,/ConfigurationForm_ctl132_addButton$/).click
        sleep 2
        assert(ie.select_list(:id,/ConfigurationForm_ctl132_cfoptions_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl132_cfoptions_state$/).select('SpringWidgets Widget')
        assert(ie.button(:id ,/ConfigurationForm_ctl132_addButton$/).exists?)
        ie.button(:id ,/ConfigurationForm_ctl132_addButton$/).click
        sleep 5
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.GetItemCount()-1,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.GetItemCount()-2,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.GetItemCount()-3,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.GetItemCount()-4,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.GetItemCount()-3,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_down').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_down').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.GetItemCount()-2,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_down').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_down').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist.GetItemCount()-1,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_down').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_down').fire_event "onclick"
        sleep 2
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_delete').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl132_cflist_delete').fire_event "onclick"
        
        # Group Sidebars
        
        assert(ie.select_list(:id,/ConfigurationForm_ctl135_cfoptions_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl135_cfoptions_state$/).select('RSS Feed')
        assert(ie.button(:id ,/ConfigurationForm_ctl135_addButton$/).exists?)
        ie.button(:id ,/ConfigurationForm_ctl135_addButton$/).click
        sleep 2
        assert(ie.select_list(:id,/ConfigurationForm_ctl135_cfoptions_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl135_cfoptions_state$/).select('SpringWidgets Widget')
        assert(ie.button(:id ,/ConfigurationForm_ctl135_addButton$/).exists?)
        ie.button(:id ,/ConfigurationForm_ctl135_addButton$/).click
        sleep 2
        assert(ie.select_list(:id,/ConfigurationForm_ctl135_cfoptions_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl135_cfoptions_state$/).select('Group List')
        assert(ie.button(:id ,/ConfigurationForm_ctl135_addButton$/).exists?)
        ie.button(:id ,/ConfigurationForm_ctl135_addButton$/).click
        sleep 5
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.GetItemCount()-1,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.GetItemCount()-2,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.GetItemCount()-3,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.GetItemCount()-4,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_up').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_up').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.GetItemCount()-3,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_down').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_down').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.GetItemCount()-2,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_down').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_down').fire_event "onclick"
        sleep 2
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.SelectItem(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist.GetItemCount()-1,true)")
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_down').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_down').fire_event "onclick"
        sleep 2
        assert(ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_delete').exists?)
        ie.button(:id,'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl135_cflist_delete').fire_event "onclick"
      end
      
    def test_15_Footer
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.SelectTab(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.GetTabAtIndex(5))")
        assert(ie.text_field(:id, 'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl143_ctl03_text').exists?)
        ie.text_field(:id, 'ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl143_ctl03_text').set('#eaece0')
        assert(ie.button(:id, /ConfigurationForm_ctl144_Button$/).exists?)
        ie.button(:id, /ConfigurationForm_ctl144_Button$/).click
        assert(ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_width').exists?)
        ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_width').value ='150'
        assert(ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_height').exists?)
        ie.frame(:index,2).text_field(:id,'ctl00_bcr_ctl00_ctl00_height').value ='150'
        assert(ie.frame(:index,2).fileField(:name,'ctl00$bcr$ctl00$ctl00$ctl08').exists?)
        ie.frame(:index,2).fileField(:name,'ctl00$bcr$ctl00$ctl00$ctl08').set($SetPath)
        assert(ie.frame(:index,2).button(:name,'ctl00$bcr$ctl00$ctl00$ctl09').exists?)
        ie.frame(:index,2).button(:name,'ctl00$bcr$ctl00$ctl00$ctl09').click
        assert(ie.frame(:index,2).link(:text , 'OK').exists?)
        ie.frame(:index,2).link(:text , 'OK').click
      end 

    def test_16_ModalWindow
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.SelectTab(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.GetTabAtIndex(6))")
        
        # Modal Window
        assert(ie.text_field(:id, /ConfigurationForm_ctl152_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl152_ctl03_text$/).set('#cccccc')
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        # Modal Window Title
        assert(ie.text_field(:id, /ConfigurationForm_ctl155_ctl03_text$/).exists?)
        ie.text_field(:id, /ConfigurationForm_ctl155_ctl03_text$/).set('#666666')
        sleep 1
        #ie.button(:value,'OK').click
        sleep 1
        assert(ie.select_list(:id,/ConfigurationForm_ctl156_ctl03_state$/).exists?)
        ie.select_list(:id,/ConfigurationForm_ctl156_ctl03_state$/).select('Impact')
        sleep 5
      end   
    
    def test_17_preview
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.SelectTab(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.GetTabAtIndex(8))")
        ie.link(:text ,'Start Live Preview').click
        ie.ie.Document.parentWindow.execScript("ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.SelectTab(ctl00_ctl00_ctl00_OuterTaskRegion_TaskRegion_TaskRegion_TaskRegion_ConfigurationForm_ctl00.GetTabAtIndex(8))")
        ie.link(:text ,'Open New Preview Window').click
        sleep 10
        ie.link(:text ,'Stop Live Preview').click
        sleep 5
    end
      
    def test_18_saveThemes
        #~ ie.link(:id,/SaveButton$/).click
        sleep  5 
        ie.link(:id,/ExportConfiguration$/).click
        ie.link(:id,/ImportButton$/).click
        sleep 5
        ie.frame(:index,2).fileField(:id,'ctl00_bcr_File').set($FilePath)
        ie.frame(:index,2).link(:id,/ImportButton$/).click
        sleep 5
        ie.link(:id,/SaveButton$/).click
        sleep 5
        ie.link(:id,/RestoreDefaultsButton$/).click
        sleep 5
        ie.link(:id,/SaveButton$/).click
      end
      
   
    def test_99_closeIE
        ie.close
    end
    
      
end 